package com.eliza.library.dao

import android.content.Context
import androidx.lifecycle.LiveData
import androidx.room.*
import com.eliza.library.model.Contactor
import com.eliza.library.model.QQUser


/*-*- coding:utf-8 -*-
 * @Author  : debi
 * @Time    : 5/1/22
 * @Software: Android Condio
 */

class QQUserRepository {
    val qqUserDao: QQUserDao

    constructor(context: Context) {
        val database: QQUserDatabase = QQUserDatabase.getInstance(context)
        qqUserDao = database.qqUserDao
    }

    suspend fun insertQQUser(vararg students: QQUser) {
        qqUserDao.insertQQUser(*students as Array<out QQUser>)
    }

    suspend fun deleteQQUser(vararg students: QQUser) {
        qqUserDao.deleteQQUser(*students as Array<out QQUser>)
    }

    suspend fun updateQQUser(vararg students: QQUser) {
        qqUserDao.updateQQUser(*students as Array<out QQUser>)
    }

    val getAllQQUserList: LiveData<List<QQUser>>
        get() = qqUserDao.getAllQQUserList()
}